﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TestAppRedo
{
	/// <summary>
	/// Interaction logic for Window1.xaml
	/// </summary>
	public partial class Window1 : Window
	{
		public Window1()
		{
			InitializeComponent();
			m_graph = new Graph();
			m_graph.AddNode("Saul");
			m_graph.AddNode("Abinadab");
			m_graph.AddNode("Eshbaal");
			m_graph.AddNode("Ish-bosheth");
			m_graph.AddNode("Malchi-shua");
			m_graph.AddNode("Ahinoam");
			m_graph.AddNode("Rizpah");
			m_graph.AddNode("Jonathan");
			m_graph.AddNode("Ishvi");
			m_graph.AddNode("Merab");
			m_graph.AddNode("Michal");
			m_graph.AddNode("David");
			m_graph.AddNode("Armoni");
			m_graph.AddNode("Mephibosheth");
			m_graph.AddNode("Mephibosheth2");
			m_graph.AddNode("Ziba");
			m_graph.AddNode("Kish");
			m_graph.AddNode("Abner");
			m_graph.AddNode("Ner");

			foreach (var node in m_graph)
			{
				if (node.Person.FirstName != "Saul")
				{
					m_graph.AddEdge("Saul", node.Person.FirstName);
					m_graph.AddEdge(node.Person.FirstName, "Saul");
				}
			}

			m_graph.AddEdge("Rizpah", "Armoni");
			m_graph.AddEdge("Armoni", "Rizpah");
			m_graph.AddEdge("Rizpah", "Mephibosheth");
			m_graph.AddEdge("Mephibosheth", "Rizpah");
			m_graph.AddEdge("Jonathan", "Mephibosheth2");
			m_graph.AddEdge("Mephibosheth2", "Jonathan");
			m_graph.AddEdge("Mephibosheth2", "Ziba");
			m_graph.AddEdge("Ziba", "Mephibosheth2");
			m_graph.AddEdge("Michal", "David");
			m_graph.AddEdge("David", "Michal");
			m_graph.AddEdge("Ner", "Abner");
			m_graph.AddEdge("Abner", "Ner");
			m_graph.AddEdge("Ner", "Kish");
			m_graph.AddEdge("Kish", "Ner");

			m_graphViewer.Graph = m_graph;

		}
	
		private Graph m_graph;
	}
}
